From 9af6d7f733dee9f5222781a13b3d0854783cde74 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 22 Apr 2019 14:21:17 +0000 Subject: [PATCH] surface: Store popup parent Store popup parents separately from transient-for parents, since these are separate concepts with different behaviors. And we need the parent in the frontend, so we can use it in the fallback move-to-rect implementation. --- gdk/broadway/gdksurface-broadway.c | 1 + gdk/gdksurfaceprivate.h | 3 ++- gdk/wayland/gdksurface-wayland.c | 1 + gdk/x11/gdksurface-x11.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index 67e8de7e4b..c8ed7e4991 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -208,6 +208,7 @@ _gdk_broadway_display_create_surface (GdkDisplay *display, g_object_unref (frame_clock); surface->surface_type = surface_type; + surface->parent = parent; surface->x = x; surface->y = y; surface->width = width; diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h index f2855ae996..25319c6b38 100644 --- a/gdk/gdksurfaceprivate.h +++ b/gdk/gdksurfaceprivate.h @@ -32,7 +32,8 @@ struct _GdkSurface GdkDisplay *display; - GdkSurface *transient_for; + GdkSurface *transient_for; /* for toplevels */ + GdkSurface *parent; /* for popups */ gpointer widget; diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index bf167354c8..e11f9dceb9 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -531,6 +531,7 @@ _gdk_wayland_display_create_surface (GdkDisplay *display, } surface->surface_type = surface_type; + surface->parent = parent; surface->x = x; surface->y = y; surface->width = width; diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index f5f8886544..0643948ec2 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -811,6 +811,7 @@ _gdk_x11_display_create_surface (GdkDisplay *display, g_object_unref (frame_clock); surface->surface_type = surface_type; + surface->parent = parent; surface->x = x; surface->y = y; surface->width = width; -- 2.30.2